class Dog(object):
    def __init__(self,name) -> None:
        self.name = name
    def game(self):
        print("[%s]蹦蹦跳跳德玩耍。。。"% self.name)
    
class XiaoTianQuan(Dog):
    def game(self):
        print("[%s]飞到天上玩耍"% self.name)

class Person(object):
    def __init__(self,name) -> None:
        self.name = name
    def game_with_dog(self,dog):
        print("[%s]和[%s]快乐地玩耍"%(self.name,dog.name))

        #让狗玩耍
        dog.game()

# 1 创建狗对象
awang = Dog("阿汪")
awang1 = XiaoTianQuan("阿汪2号")
# 2 创建人物对象
xiaowang = Person("小王")
# 3 人物调用玩耍方法
xiaowang.game_with_dog(awang)
xiaowang.game_with_dog(awang1)